<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">
    <body>
        <ui:composition template="Template.xhtml">
            <ui:param name="title" value="Lista de Cidades"/>
            <ui:define name="content">
                <h:form>
                    <rich:dataTable value="#{CidadeBo.cidadeTos}" var="item" width="700px" rowClasses="classeOne,classTwo" columnClasses="center"
                                    rows="15" reRender="ds">
                        <f:facet name="header">
                            <h:outputText value="Lista de Cidades"/>
                        </f:facet>
                        <rich:column sortBy="#{item.municipio}">
                            <f:facet name="header">
                                <h:outputText value="Código Municipio"/>
                            </f:facet>
                            <h:outputText value="#{item.municipio}"/>
                        </rich:column>
                        <rich:column sortBy="#{item.descricao}">
                            <f:facet name="header">
                                <h:outputText value="Cidade"/>
                            </f:facet>
                            <h:outputText value="#{item.descricao}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="UF"/>
                            </f:facet>
                            <h:outputText value="#{item.uf}"/>
                        </rich:column>
                        <rich:column  >
                            <f:facet name="header">
                                <h:outputText value="Ações"/>
                            </f:facet>
                            <h:commandButton value= "Alterar" accesskey="A" styleClass="button" action="#{CidadeBo.iniciaEditCid}" >
                                <f:setPropertyActionListener target="#{CidadeBo.selectCidade}" value="#{item}"/>
                            </h:commandButton>

                        </rich:column>
                        <f:facet name="footer">
                            <rich:datascroller id="ds"></rich:datascroller>
                        </f:facet>
                    </rich:dataTable>


                </h:form>

            </ui:define>


        </ui:composition>


    </body>
</html>

